$('.tab-item').eq(1).addClass('active');

var registerForm = $('#registerForm').validate({
  rules:{
    username: {
      required: true,
      // minlength: 3,
      // minlength: 8
      rangelength:[3,8]
    },
    password: {
      required: true,
      minlength: 5
    },
    confirm_password: {
      required: true,
      minlength: 5,
      equalTo: ".password"
    },
    email: {
      required: true,
      email: true
    }
  },
  messages:{
    username: {
      required: "请输入账户",
      // minlength: "用户名长度不能小于3个字母",
      // maxlength: "用户名长度不能大于8个字母"
      rangelength:"用户名长度为3-8个字母"
    },
    password: {
      required: "请输入密码",
      minlength: "密码长度不能小于5个字母"
    },
    confirm_password: {
      required: "请输入密码",
      minlength: "密码长度不能小于5个字母",
      equalTo: "两次密码输入不一致,请确认"
    },
    email: "请输入邮箱",
  },
  errorPlacement: function(error, element) { //错误信息位置设置方法
    element.parent().append('<span class="error-message"></span>');
    error.appendTo(element.parent().find('.error-message'));
  },
})



// $('.tab-item').on('click', function() {
//     var index = $(this).index();
//     $('.tab-item').removeClass('active');
//     $(this).addClass('active');
//     $('.tab-main').addClass('hide');
//     $('.tab-main').eq(index).removeClass('hide');
//     if (index == 0) {
//       console.log(signinForm)
//       registerForm.resetForm();
//     } else {
//       console.log(registerForm)
//       signinForm.resetForm();
//     }
// });


